<!doctype html>
<html lang="en">
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <title>图书列表</title>
</head>

<body>
<h1 class="text-center pt-3 pb-3">图书列表</h1>

<div class="container">
    <div class="offset-md-2 col-md-8">
        <table class="table table-bordered">
            <thead>
            <tr>
                <th>图书编号</th>
                <th>图书名称</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <#list bookPage.dataList as b>
                <tr>
                    <td>${b.bid}</td>
                    <td>
                        <#list b.bookInfo as info>
                            ${info.name}
                        </#list>
                    </td>
                    <td>
                        <a href="">修改</a> /
                        <a href="">删除</a>
                    </td>
                </tr>
            </#list>
            </tbody>
        </table>

        <nav class="pb-5 pt-3">
            <ul class="pagination justify-content-center">
                <li class="page-item ${(bookPage.pageNum==1)?string("disabled","")}">
                    <a class="page-link" href="/get_books?page=1" tabindex="-1">首页</a>
                </li>

                <#list 1..bookPage.pageCount as i>
                    <li class="page-item ${(bookPage.pageNum==i)?string("active","")}">
                        <a class="page-link" href="/get_books?page=${i}">${i}</a>
                    </li>
                </#list>

                <li class="page-item ${(bookPage.pageNum==bookPage.pageCount)?string("disabled","")}">
                    <a class="page-link" href="/get_books?page=${bookPage.pageCount}">末页</a>
                </li>
            </ul>
        </nav>
    </div>
</div>
</body>
</html>
